package com.itcoon.cloud.framework.security.auth.config;

import com.itcoon.cloud.framework.security.auth.jackson.UserPrincipalDeserializer;
import com.itcoon.cloud.framework.security.auth.oauth2.handler.OAuth2AuthenticationFailureHandler;
import com.itcoon.cloud.framework.security.auth.oauth2.handler.OAuth2AuthenticationSuccessHandler;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Bean;

/**
 * Date: 1/19/25 7:47 PM
 * @author: Athric yu
 */
@AutoConfiguration
public class OAuth2BeanAutoConfiguration {

    @Bean
    public OAuth2AuthenticationSuccessHandler oAuth2AuthenticationSuccessHandler(){
        return new OAuth2AuthenticationSuccessHandler();
    }

    @Bean
    public OAuth2AuthenticationFailureHandler oAuth2AuthenticationFailureHandler(){
        return new OAuth2AuthenticationFailureHandler();
    }

    @Bean
    public UserPrincipalDeserializer userPrincipalDeserializer(){
        return new UserPrincipalDeserializer();
    }
}
